Open
Conversation
tinojdev
reviewed
Feb 25, 2026
| export default DataCaptureContext.instance; | ||
| ``` | ||
| ```ts | ||
| await DataCaptureContext.initialize('-- ENTER YOUR SCANDIT LICENSE KEY HERE --'); |
Contributor
There was a problem hiding this comment.
I don't think initialize is an async function
tinojdev
reviewed
Feb 25, 2026
| const barcodeSelection = new Scandit.BarcodeSelection(settings); | ||
| context.addMode(barcodeSelection); | ||
| const barcodeSelection = new BarcodeSelection(settings); | ||
| DataCaptureContext.sharedInstance.addMode(barcodeSelection); |
Contributor
There was a problem hiding this comment.
This would be an awaitable
tinojdev
reviewed
Feb 25, 2026
Comment on lines
40
to
148
| @@ -85,7 +87,7 @@ Next, create a [BarcodeSelection](https://docs.scandit.com/data-capture-sdk/cord | |||
|
|
|||
| ```js | |||
| const barcodeSelection = new Scandit.BarcodeSelection(settings); | |||
| context.addMode(barcodeSelection); | |||
| DataCaptureContext.sharedInstance.addMode(barcodeSelection); | |||
| ``` | |||
|
|
|||
| ## Register the Barcode Selection Listener | |||
| @@ -126,7 +128,7 @@ When using the built-in camera there are recommended settings for each capture m | |||
| recommended settings and create the camera from it: | |||
|
|
|||
| ```js | |||
| const cameraSettings = Scandit.BarcodeSelection.recommendedCameraSettings; | |||
| const cameraSettings = Scandit.BarcodeSelection.createRecommendedCameraSettings(); | |||
|
|
|||
| // Depending on the use case further camera settings adjustments can be made here. | |||
|
|
|||
| @@ -141,7 +143,7 @@ Because the frame source is configurable, the data capture context must be told | |||
| [DataCaptureContext.setFrameSource()](https://docs.scandit.com/data-capture-sdk/cordova/core/api/data-capture-context.html#method-scandit.datacapture.core.DataCaptureContext.SetFrameSourceAsync): | |||
|
|
|||
| ```js | |||
| context.setFrameSource(camera); | |||
| DataCaptureContext.sharedInstance.setFrameSource(camera); | |||
| ``` | |||
|
|
|||
Contributor
There was a problem hiding this comment.
Would DataCaptureContext here need to be Scandit.DataCaptureContext?
tinojdev
reviewed
Feb 25, 2026
|
|
||
| ```js | ||
| let barcodeAr; | ||
| let barcodeArView; |
tinojdev
reviewed
Feb 25, 2026
|
|
||
| ```js | ||
| let barcodeFind; | ||
| let barcodeFindView; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In addition to the fixes on the code snippets for Flutter, React-Native, Cordova, Capacitor and Titanium I have also updated the DataCaptureContext initialization pattern across Flutter, Capacitor, Cordova, and React Native docs
This MR updates the documentation to reflect the new DataCaptureContext API, where initialization is done once via an async call and the context is accessed afterwards through a shared instance.
Code snippets